<% if job_executions.any? %>
  <table class="table">
    <thead>
    <tr>
      <th>Project</th>
      <th>When</th>
      <th>Who</th>
      <th>Stage</th>
      <th>Status</th>
      <th></th>
    </tr>
    </thead>
    <tbody>
    <% job_executions.each do |queue, job_exs| %>
      <tr><td colspan="6">Queue <%= queue %></td></tr>
      <% Array(job_exs).each do |job_ex| %>
        <% if job_ex.is_a?(JobExecution) %>
          <% job = job_ex.job %>
          <% if deploy = job.deploy %>
            <%= render deploy %>
          <% else %>
            <tr>
              <td><%= link_to_resource job.project %></td>
              <td><%= render_time(job.created_at) %></td>
              <td><%= link_to "#{job.summary}", [job.project, job] %></td>
              <td></td>
              <td><%= status_badge job.status %></td>
            </tr>
          <% end %>
        <% else %>
          <tr>
            <td><%= job_ex.class %>: <%= job_ex.id %></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
        <% end %>
      <% end %>
    <% end %>
    </tbody>
  </table>
<% else %>
  None
<% end %>
